﻿@using Webdiyer.WebControls.Mvc;
@model Webdiyer.WebControls.Mvc.PagedList<BaseData.Model.ProductsStore>
@{
    var idx = 0;
    long curnum = 0;
}


<table class="table table-hover">
    <thead>
    <tr>
        <th>
            序号
        </th>
        <th>
            产品条码
        </th>
        <th>
           产品名称
        </th>
        <th>
           总进货量
        </th>
        <th>
           总销售量
        </th>
        <th>
           总货损量
        </th>
       <th>
           可用库存
       </th>
    </tr>
    </thead>
    @foreach (var item in Model)
    {
        idx++;
        curnum = item.TotalInNum - item.TotalSaleNum - item.TotalBreakNum;
        <tr>
            <td>
                @idx
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.ProductCode)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.Product.ProdcutName)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.TotalInNum)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.TotalSaleNum)
            </td>
            <td>
                @Html.DisplayFor(modelItem => item.TotalBreakNum)
            </td>
            <td style=" font-size:larger; color:red">
                @curnum
            </td>
        </tr>
    }

</table>

<hr />
<div style="padding-top:5px; width:100%">
    <div style="float:left">共 @Model.TotalPageCount 页 @Model.TotalItemCount 条记录，当前为第 @Model.CurrentPageIndex 页</div>
    @Ajax.Pager(Model, new PagerOptions { PageIndexParameterName = "id", ShowPageIndexBox = false, PageIndexBoxType = PageIndexBoxType.DropDownList, ShowGoButton = false }, new MvcAjaxOptions { UpdateTargetId = "tables", DataFormId = "searchForm" }, new { style = "float:right" })
</div>